﻿@model ElCharro01.Models.Cart
@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="sfondo">
    <div class="paddalo">
        @if (Model.CartDetail.Count() != 0)
        {
            <h2 class="centered">
                Ecco cosa c'è nel tuo carrello</h2>

            <table align="center">
                <tr>
                    <th>
                        Nome Prodotto
                    </th>
                    <th>
                        Colore
                    </th>
                    <th>
                        Taglia
                    </th>
                    <th>
                        Quantità
                    </th>
                    <th>
                        Prezzo Unitario
                    </th>
                    <th>
                        Totale Per Questo Articolo
                    </th>
                    <th>
                    </th>
                    <th>
                    </th>
                    <th>
                    </th>
                </tr>
                @foreach (var item in Model.CartDetail)
                {
                    <tr>
                        <td>@Html.DisplayFor(modelItem => item.Variant.Product.Nome)
                        </td>
                        <td>@Html.DisplayFor(modelItem => item.Variant.Colore)
                        </td>
                        <td>@Html.DisplayFor(modelItem => item.Variant.Taglia)
                        </td>
                        <td>@Html.DisplayFor(modelItem => item.Quantita)
                        </td>
                        <td>@Html.DisplayFor(modelItem => item.Variant.PrezzoUnitario) €
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Totale) €
                        </td>
                        <td>
                            <a href="@Url.Action("IncreaseQuantity", "CartDetail", new { cartDetailId = item.ID })">
                                <img alt="Aumenta Quantità" src="/Content/Images/plus.png" />
                            </a>
                        </td>
                        <td>
                            <a href="@Url.Action("DecreaseQuantity", "CartDetail", new { cartDetailId = item.ID })">
                                <img alt="Aumenta Quantità" src="/Content/Images/minus.png" />
                            </a>
                        </td>
                        <td>@Html.ActionLink("Elimina Dal Carrello", "Delete", "CartDetail", new { cartDetailId = item.ID }, new { })
                        </td>
                    </tr>
  
                }
            </table>
            <div align="center">
                Prezzo Totale: @Model.Totale €</div>
            <div align="center">
            @Html.ActionLink("Effettua CheckOut", "OrderConfirm", "CheckOut")
            </div>
        }
        else
        {
            <div>
                Carrello Vuoto
             </div>
  
        }
    </div>
</div>
